using EstimateTracker.DataAccess;
using EstimateTracker.DataAccess.Repositories;
using EstimateTracker.Services;
using EstimateTracker.ViewModels;
using Microsoft.Practices.Prism.Events;
using Ninject.Modules;

namespace EstimateTracker
{
    public class EstimateTrackerModule : NinjectModule
    {
        public override void Load()
        {
            Kernel.Bind<IPersistenceManager>().To<PersistenceManager>().InSingletonScope();

            Kernel.Bind<IActivityRepository>().To<ActivityRepository>().InSingletonScope();
            Kernel.Bind<ITaskRepository>().To<TaskRepository>().InSingletonScope();
            Kernel.Bind<IProjectRepository>().To<ProjectRepository>().InSingletonScope();
            Kernel.Bind<IHoursWorkedRepository>().To<HoursWorkedRepository>().InSingletonScope();

            Kernel.Bind<IProjectService>().To<ProjectService>().InSingletonScope();
            Kernel.Bind<ITimerService>().To<TimerService>().InSingletonScope();

            Kernel.Bind<IEventAggregator>().To<EventAggregator>().InSingletonScope();

            Kernel.Bind<ProjectViewModel>().ToSelf().InSingletonScope();
            Kernel.Bind<TimerTabViewModel>().ToSelf().InSingletonScope();
            Kernel.Bind<TaskViewModel>().ToSelf().InSingletonScope();
            Kernel.Bind<ActivityViewModel>().ToSelf().InSingletonScope();
            Kernel.Bind<ReportSummaryViewModel>().ToSelf().InSingletonScope();
        }
    }
}